#import "TranquilVelvetCell.h"


@implementation TranquilVelvetCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
	self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
	if (self) {

		self.selectionStyle = UITableViewCellSelectionStyleNone;
		//self.contentView.backgroundColor = UIColor.whiteColor;

		//: 初始化UI布局
		[self braveIdealJeopardySetupViews];
	}
	return self;
}

- (void)setResonateZipper:(TranquilVelvetModel *)resonateZipper {
	_resonateZipper = resonateZipper;

	//: 配置cell的UI

[self.tranquilityClarityZealImageView sd_setImageWithURL:[NSURL URLWithString:resonateZipper.enigmaHopeful.stringValue] placeholderImage:nil];



	NSString *quirk = [NSString stringWithFormat:@"%ld", resonateZipper.glistenQuestFusion];
	self.journeyTranquilMotionLabel.text = quirk;

}
- (UILabel *)oasisZephyrXeroxLabel {
	if (!_oasisZephyrXeroxLabel) {
	
        _oasisZephyrXeroxLabel = [[UILabel alloc] init];
        _oasisZephyrXeroxLabel.frame = CGRectMake(17, 35, 70, 122);
        _oasisZephyrXeroxLabel.text = @"label_0";
        _oasisZephyrXeroxLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
        _oasisZephyrXeroxLabel.textColor = [UIColor colorWithRed:65/255.0 green:229/255.0 blue:21/255.0 alpha:0.7];
        _oasisZephyrXeroxLabel.textAlignment = NSTextAlignmentRight;
        //: 不用理会的骚操作 = _oasisZephyrXeroxLabel.numberOfLines = 1;
        NSInteger flourish = 1;
        if (flourish>30 && flourish < 3540) {
	        flourish = 53;
        }
        _oasisZephyrXeroxLabel.numberOfLines = flourish;
	}
	return _oasisZephyrXeroxLabel;
}

//: 设置whisperFlourishXenophile的圆角
- (void)heatwave:(UIImageView *)abandonWaffleMagnitude brillianceCharismaVelvet:(CGFloat)dreamOdysseyYard {
	abandonWaffleMagnitude.layer.cornerRadius = dreamOdysseyYard;
	abandonWaffleMagnitude.layer.masksToBounds = YES;
}

- (UITextView *)opulentReverieTextView {
	if (!_opulentReverieTextView) {
	
        _opulentReverieTextView = [[UITextView alloc] initWithFrame:CGRectZero];
	}
	return _opulentReverieTextView;
}

//: apexQuixoticKeepsake 的点击事件
- (void)action_4 {}

//: self.elevateButton 的点击事件
- (void)action_6 {}

//: _gracefulEchoesBtn 的点击事件
- (void)action_7 {}

- (UIButton *)gracefulEchoesBtn {
	if (!_gracefulEchoesBtn) {
	
        _gracefulEchoesBtn = [[UIButton alloc] initWithFrame:CGRectZero];
        UIImage *gracefulGrumpy = [UIImage imageNamed:@"images/icon_7.png"];
        if (gracefulGrumpy) {
	        [_gracefulEchoesBtn setImage:gracefulGrumpy forState:UIControlStateNormal];
        }
        [_gracefulEchoesBtn setTitle:@"button_7" forState:UIControlStateNormal];
        [_gracefulEchoesBtn setTitle:@"button_selected_7" forState:UIControlStateSelected];
        [_gracefulEchoesBtn setTitleColor:[UIColor colorWithRed:158/255.0 green:158/255.0 blue:60/255.0 alpha:0.7] forState:UIControlStateNormal];
        [_gracefulEchoesBtn setTitleColor:[UIColor colorWithRed:40/255.0 green:62/255.0 blue:157/255.0 alpha:0.6] forState:UIControlStateSelected];
        [_gracefulEchoesBtn addTarget:self action:@selector(action_7) forControlEvents:UIControlEventTouchUpInside];
	}
	return _gracefulEchoesBtn;
}

//: 设置_keyholeVelvetKeepsakeImageView的圆角
+ (void)abandon:(UIImageView *)sereneJewel joyousOnwardLush:(CGFloat)duskImagination {
	sereneJewel.layer.cornerRadius = duskImagination;
	sereneJewel.layer.masksToBounds = YES;
}

- (UIImageView *)keyholeVelvetKeepsakeImageView {
	if (!_keyholeVelvetKeepsakeImageView) {
	
        _keyholeVelvetKeepsakeImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
        _keyholeVelvetKeepsakeImageView.contentMode = UIViewContentModeScaleAspectFill;
        _keyholeVelvetKeepsakeImageView.clipsToBounds = YES;
        //: UIImageView的骚操作 充数
        [TranquilVelvetCell abandon:_keyholeVelvetKeepsakeImageView joyousOnwardLush:14];
        _keyholeVelvetKeepsakeImageView.frame = CGRectMake(9, 38, 150, 154);
        UIImage *prismPioneerCirculate = [UIImage imageNamed:@"images/image_8.png"];
        if (prismPioneerCirculate) {
	        _keyholeVelvetKeepsakeImageView.image = prismPioneerCirculate;
        }
	}
	return _keyholeVelvetKeepsakeImageView;
}

//: 设置self.journeyTranquilMotionLabel的numberOfLines
+ (NSInteger)pioneerNostalgiaFlexibility:(NSInteger)freedomHeatwaveXenial enigmaJoyous:(NSString *)oracleQuest {
	NSInteger radiateImprint = 16;
	if (radiateImprint != -20 && radiateImprint > 3170 && oracleQuest) {

		NSString *reverie = [NSString stringWithFormat:@"img_%ld", (long)radiateImprint];
		NSData *elevateNirvanaXenophobe = [reverie dataUsingEncoding:NSUTF8StringEncoding];
		if (elevateNirvanaXenophobe && [oracleQuest isEqualToString:reverie]) return radiateImprint / 85;

		return radiateImprint * 44;
	}
	return radiateImprint - 14;
}

- (void)braveIdealJeopardySetupViews {
	//: 描述_0
	[self.contentView addSubview:self.oasisZephyrXeroxLabel];


    //: 描述_1
    UIImageView *whisperFlourishXenophile = [UIImageView new];
    whisperFlourishXenophile.contentMode = UIViewContentModeScaleAspectFill;
    whisperFlourishXenophile.clipsToBounds = YES;
    //: UIImageView的骚操作 充数
    [self heatwave:whisperFlourishXenophile brillianceCharismaVelvet:4];
    UIImage *zipperEnigmaMerge = [UIImage imageNamed:@"images/image_1.png"];
    if (zipperEnigmaMerge) {
	    whisperFlourishXenophile.image = zipperEnigmaMerge;
    }
    self.tranquilityClarityZealImageView = whisperFlourishXenophile;
    [self.contentView addSubview:whisperFlourishXenophile];
	[self.tranquilityClarityZealImageView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(93);
		make.height.mas_equalTo(149);
		make.top.equalTo(@(25));
		make.bottom.equalTo(@(27));
	}];

	//: 描述_2
	[self.contentView addSubview:self.opulentReverieTextView];
	[self.opulentReverieTextView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(39);
		make.height.mas_equalTo(65);
	}];


    //: 描述_3
    UITextField *yearnPictureNavigate = [[UITextField alloc] init];
    self.kaleidoscopeTextField = yearnPictureNavigate;
    [self.contentView addSubview:yearnPictureNavigate];
	[self.kaleidoscopeTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(59);
		make.height.mas_equalTo(178);
		make.top.equalTo(@(14));
	}];


    //: 描述_4
    UIButton *apexQuixoticKeepsake = [UIButton new];
    UIImage *merge = [UIImage imageNamed:@"images/icon_4.png"];
    if (merge) {
	    [apexQuixoticKeepsake setImage:merge forState:UIControlStateNormal];
    }
    [apexQuixoticKeepsake setTitle:@"button_4" forState:UIControlStateNormal];
    [apexQuixoticKeepsake setTitle:@"button_selected_4" forState:UIControlStateSelected];
    [apexQuixoticKeepsake setTitleColor:[UIColor colorWithRed:121/255.0 green:246/255.0 blue:81/255.0 alpha:1.0] forState:UIControlStateNormal];
    [apexQuixoticKeepsake setTitleColor:[UIColor colorWithRed:127/255.0 green:58/255.0 blue:75/255.0 alpha:0.6] forState:UIControlStateSelected];
    [apexQuixoticKeepsake addTarget:self action:@selector(action_4) forControlEvents:UIControlEventTouchUpInside];
    self.mergeNostalgicHopeBtn = apexQuixoticKeepsake;
    [self.contentView addSubview:apexQuixoticKeepsake];
	[self.mergeNostalgicHopeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(64);
		make.height.mas_equalTo(62);
		make.top.equalTo(@(24));
	}];


    //: 描述_5
    UITextField *knotTranquilHover = [UITextField new];
    self.spiralTextField = knotTranquilHover;
    [self.contentView addSubview:knotTranquilHover];
	[self.spiralTextField mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(107);
		make.height.mas_equalTo(88);
		make.bottom.equalTo(@(16));
	}];


    //: 描述_6
    self.elevateButton = [[UIButton alloc] init];
    self.elevateButton.frame = CGRectMake(40, 22, 165, 37);
    UIImage *tranquility = [UIImage imageNamed:@"images/icon_6.png"];
    if (tranquility) {
	    [self.elevateButton setImage:tranquility forState:UIControlStateNormal];
    }
    [self.elevateButton setTitle:@"button_6" forState:UIControlStateNormal];
    [self.elevateButton setTitle:@"button_selected_6" forState:UIControlStateSelected];
    [self.elevateButton setTitleColor:[UIColor colorWithRed:231/255.0 green:119/255.0 blue:246/255.0 alpha:0.8] forState:UIControlStateNormal];
    [self.elevateButton setTitleColor:[UIColor colorWithRed:247/255.0 green:234/255.0 blue:41/255.0 alpha:0.7] forState:UIControlStateSelected];
    [self.elevateButton addTarget:self action:@selector(action_6) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:self.elevateButton];

	//: 描述_7
	[self.contentView addSubview:self.gracefulEchoesBtn];
	[self.gracefulEchoesBtn mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(195);
		make.height.mas_equalTo(36);
		make.top.equalTo(@(26));
	}];

	//: 描述_8
	[self.contentView addSubview:self.keyholeVelvetKeepsakeImageView];


    //: 描述_9
    self.journeyTranquilMotionLabel = [[UILabel alloc] init];
    self.journeyTranquilMotionLabel.text = @"label_9";
    self.journeyTranquilMotionLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightRegular];
    self.journeyTranquilMotionLabel.textColor = [UIColor colorWithRed:47/255.0 green:168/255.0 blue:90/255.0 alpha:1.0];
    self.journeyTranquilMotionLabel.textAlignment = NSTextAlignmentRight;
    //: UILabel的骚操作 充数
    self.journeyTranquilMotionLabel.numberOfLines = [TranquilVelvetCell pioneerNostalgiaFlexibility:2 enigmaJoyous:@"apprehensionZealot"];
    [self.contentView addSubview:self.journeyTranquilMotionLabel];
	[self.journeyTranquilMotionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
		make.width.mas_equalTo(123);
		make.height.mas_equalTo(99);
		make.bottom.equalTo(@(24));
	}];
}


@end